<template>
  <div class="box">
    <myHeader
      leftText="返回"
      rightText="书架"
      title="图书商城"
      @leftBtn="$router.go(-1)"
      @rightClick="$router.push('/myBookS')"
    ></myHeader>
    <div class="listBox">
      <my-card v-for="(v, i) in obj" :key="i" :item="v"></my-card>
    </div>
  </div>
</template>

<script>
import myHeader from "@/components/myHeader";
import myCard from "../components/myCard.vue";
import { computed } from "vue";
import { useStore } from "vuex";
export default {
  setup() {
    let store = useStore();
    let obj = computed(() => store.state.bookObj);
    function bookGo() {
      console.log(1);
    }
    store.dispatch("getList");
    console.log(obj.value);
    return {
      obj,
      bookGo,
    };
  },
  components: { myHeader, myCard },
};
</script>

<style lang="scss" scoped>
.listBox {
  display: flex;
  flex-wrap: wrap;
}
</style>
